using System;

namespace RealDolmen.SharePoint.ListFeatures
{
    public class ListFeatureCompiledReceiverData
    {

        #region Fields
        public string TrackerData;
        public string Data; 
        #endregion // Fields

        #region Constructors
        public ListFeatureCompiledReceiverData(string trackerData, string data)
        {
            TrackerData = trackerData;
            Data = data;
        }

        public ListFeatureCompiledReceiverData(string compiled)
        {
            Compiled = compiled;
        } 
        #endregion // Constructors

        #region Business Methods
        public string Compiled
        {
            get { return string.Format("{0}{1}{2}", TrackerData, Core.SEPARATORSTRING, Data); }
            set
            {
                string[] splitted = value.Split(new string[] { Core.SEPARATORSTRING }, StringSplitOptions.RemoveEmptyEntries);
                if (splitted.Length > 0)
                    TrackerData = splitted[0];
                if (splitted.Length > 1)
                    Data = splitted[1];
            }
        } 
        #endregion // Business Methods
    }
}
